package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFaAutoRegisterToManagerDao;
import com.financing.platform.dto.FaAutoRegisterToManagerDTO;
import com.financing.platform.util.SqlName;
/**
 * fa_auto_register_to_manager  
 * 自动分配流水 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("faAutoRegisterToManagerDao")
public class FaAutoRegisterToManagerDaoImpl extends BaseDaoImpl implements IFaAutoRegisterToManagerDao {


	@Override
	public int insert(FaAutoRegisterToManagerDTO faAutoRegisterToManager) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.FaAutoRegisterToManagerSql.insert, faAutoRegisterToManager);
	}

	@Override
	public void update(FaAutoRegisterToManagerDTO faAutoRegisterToManager) throws SQLException {
		this.sqlMapClient.update(SqlName.FaAutoRegisterToManagerSql.update, faAutoRegisterToManager);
	}

	@Override
	public void updateForce(FaAutoRegisterToManagerDTO faAutoRegisterToManager) throws SQLException {
		this.sqlMapClient.update(SqlName.FaAutoRegisterToManagerSql.updateForce, faAutoRegisterToManager);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FaAutoRegisterToManagerSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FaAutoRegisterToManagerDTO> queryList(FaAutoRegisterToManagerDTO faAutoRegisterToManager) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FaAutoRegisterToManagerSql.queryList, faAutoRegisterToManager);
	}

	@Override
	public int queryListCount(FaAutoRegisterToManagerDTO faAutoRegisterToManager) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FaAutoRegisterToManagerSql.queryListCount, faAutoRegisterToManager);
	}

	@Override
	public FaAutoRegisterToManagerDTO loadById(Integer id) throws SQLException {
		return  (FaAutoRegisterToManagerDTO)this.sqlMapClient.queryForObject(SqlName.FaAutoRegisterToManagerSql.loadById,id);
	}

	@Override
	public Map<String, Object> quqeryAutoUser(
			FaAutoRegisterToManagerDTO faAutoRegisterToManager)
			throws SQLException {
		return  (Map<String, Object>) this.sqlMapClient.queryForObject(SqlName.FaAutoRegisterToManagerSql.queryAutoUser,faAutoRegisterToManager);
	}

	@Override
	public Map<String, String> queryCurrentMonthUser(
			FaAutoRegisterToManagerDTO faAutoRegisterToManager)
			throws SQLException {
		return  this.sqlMapClient.queryForMap(SqlName.FaAutoRegisterToManagerSql.queryCurrentMonthUser,faAutoRegisterToManager,"type","monthCount");
	}
 	
}
